﻿@using Webdiyer.WebControls.Mvc
@model PagedList<NationalIT.Owners>
<h3>
    Owners Info</h3>
<div class="row-fluid">
    <div class="row-fluid">
        <div class="span12">
            @Html.Partial("_MenuButtonNewEditOrDelete")
        </div>
    </div>
    <table class="table">
        <tr>
            <th>
                <input type="checkbox" name="" value="" class="checkAll" />
            </th>
            <th>
                ID
            </th>
            <th>
                Name
            </th>
            <th>
                ssn_
            </th>
            <th>
                fee_rate
            </th>
            <th>
                pay_rate
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    <input type="checkbox" name="checkOwner" value="@item.OwnerID" class="checkitem"/>
                </td>
                <td>
                    @Html.ActionLink(item.OwnerID.ToString(), "NewOrEdit", new { id = item.OwnerID })
                </td>
                <td>
                    @Html.ActionLink(item.Name, "NewOrEdit", new { id = item.OwnerID })
                </td>
                <td>
                    @item.ssn_
                </td>
                <td>
                    @String.Format("{0:C}", item.fee_rate)
                </td>
                <td>
                    @String.Format("{0:C}", item.pay_rate).Replace("$",null)
                </td>
            </tr>
        }
    </table>
    <div class="row-fluid">
        <div class="span4">
            <div class="dataTables_info">
                @if (Model.TotalItemCount > 0)
                {
                    if (Model.TotalItemCount < Model.PageSize)
                    {
                    <span>1 </span>
                    <span>- </span>@Model.TotalItemCount
                    }
                    else
                    {
                    <span></span>@((Model.CurrentPageIndex - 1) * Model.PageSize + 1)
                    <span>- </span>@((Model.CurrentPageIndex != Model.TotalPageCount) ? (Model.CurrentPageIndex * Model.PageSize) : Math.Abs((Model.CurrentPageIndex) * Model.PageSize - (Model.PageSize * Model.TotalPageCount) - Model.TotalItemCount))
                    }
                    <span>of </span>@(Model.TotalItemCount)
                            
                }
            </div>
        </div>
        <div class="span8">
            <div class="dataTables_paginate paging_bootstrap pagination phantrangmvcpager">
                @* <ul>
                        <li class="prev disabled"><a href="#">← Prev</a></li><li class="active"><a href="#">
                            1</a></li><li><a href="#">2</a></li><li class="next"><a href="#">Next → </a>
                        </li>
                    </ul>*@
                @Html.Pager(Model, new PagerOptions { ContainerTagName = "ul", PageIndexParameterName = "page", CurrentPagerItemWrapperFormatString = "<li class='active'>{0}</li>", CurrentPageNumberFormatString = "{0}", FirstPageText = "&laquo; ", LastPageText = " &raquo;", NextPageText = "Next →", PrevPageText = "← Prev", SeparatorHtml = "" })
            </div>
        </div>
    </div>
</div>
